package com.z.web;

import org.springframework.boot.autoconfigure.web.ErrorController;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class IndexManagerController implements ErrorController{

	@GetMapping(path = "/{username}/index")
	@ResponseBody
	public String index(@PathVariable String username) {
		System.out.println("IndexManagerController.index()");
		System.out.println(username);
		return "hello world23123123";
	}

	@Override
	public String getErrorPath() {
		return "/error";
	}
	
	@GetMapping(path="/{username}/users")
	public String getUser(@PathVariable String username){
		System.out.println("IndexManagerController.getUser()");
		return "hello:"+username;
	}
	
	@GetMapping(path="/{username}/users1")
	public String getUser1(@PathVariable String username){
		System.out.println("IndexManagerController.getUser()");
		return "hello:"+username+"=======";
	}
}
